package com.xiaoy.core.base.menu.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.xiaoy.core.base.menu.entity.Menu;
import com.xiaoy.core.base.security.role.entity.Role;
import com.xiaoy.dao.HibernateDaoWrapper;
import com.xiaoy.util.store.config.ConfigTable;

@Repository("menuDao")
public class MenuDao extends HibernateDaoWrapper<Menu, Long>{

	
	public List<Menu> getMenuByRole (List<Role> roles){
		
		return null;
		
	}
	
	public List<Menu>getRootMenu () {
		
		String sql = "select * from ".concat(ConfigTable.Base.MENU_TABLENAME+" where pid is null");
		return getSession().createSQLQuery(sql).addEntity(entityClass).list();
	}
	
}
